<!--上传插件-->
<!--<script src="/static/js/jquery-2.1.1.js"></script>-->
<!--<script src="/static/bootstrap/js/bootstrap.js"></script>-->
<!--<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>-->

<!--<link href="/static/layui/css/layui.css" rel="stylesheet"/>-->
<!--<script src="/static/layui/layui.js"></script>-->
<!--引用layui弹框插件-->

<!--<script src="/static/js/yii.js"></script>-->

<link href="/static/css/fileinput.css" rel="stylesheet"/>
<script src="/static/js/fileinput.js"></script>
<script src="/static/js/fileinput_locale_zh.js" type="text/javascript"></script>

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" close="true">
        <span aria-hidden="true">×</span>
    </button>
    <h4 class="modal-title">
        <span class="fa fa-legal"></span>&nbsp;编辑幻灯片
    </h4>
</div>
<style>


</style>
<div class="modal-body">
    <form class="form-horizontal">
        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*名称:</label>
            <div class="col-sm-4">
                <input class="form-control" name="title" placeholder="名称" value="">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">*图片:</label>
            <div class="col-sm-4">
                <div class="input-group ">
                    <input type="text" id="logo" name="thumb" value="" class="form-control"  autocomplete="off">
                    <span class="input-group-btn">
                        <button class="btn btn-default js_upload" id="upload" type="button" data-original-title="" title="">选择图片</button>
                    </span>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*跳转链接:</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" name="wxapp_link" placeholder="跳转链接" >
            </div>
        </div>



        <div class="form-group">
            <label for="" class="col-sm-3 control-label">是否启用:</label>
            <div class="col-sm-8">
                <div class="radio">
                    <label>
                        <input type="radio" name="status" value="1" checked> 启用
                    </label>
                    <label>
                        <input type="radio" name="status"  value="2">禁用
                    </label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="" class="col-sm-3 control-label">排序:</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" name="sort" placeholder="排序">
                <p class="help-block">数字越大，越靠前</p>
            </div>
        </div>



    </form>
</div>
<div class="modal-footer">
    <button type="button" class="layui-btn layui-btn-primary" close="true">关闭</button>
    <button type="button" class="layui-btn" _event="add">保存</button>
</div>

<script>



    var newModal = new yii.modal();
    //添加页面
    $(".js_upload").click(function () {
        $(newModal.getid()).show();
        newModal.initialization({
            url: "{:URL('home/Upload/index')}",
            type: "post",
            data:{
                type:'detail'
            }
        });
    });

    newModal.on("upload",function(data){
        var images = '';
        $(newModal.getid()).find("#data-area .newimages .active img").each(function () {
            images = $(this).attr('src');
            return false
        })
        //$(newModal.getid()).hide();
        $("#logo").val(images);
    });


    $(this).find('.modal-dialog').css({
        'width': '800px'
    });

</script>